Repository navigation
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
Initialize every member of the AGC decoded state (shader stages, color and depth targets, viewport, scissor, blend state and blend constants) so the draw key compares defined values instead of indeterminate memory. Bound the NGS2 custom module option word read to the option size the guest declares, clamp the recorder sync source before indexing its per-source counters, and destroy a thread-owned object when registering it throws. Widen the operands of the depth, texture, vertex input, VideoOut and Mach-O size expressions before multiplying, cast the register proxies passed to fprintf, and drop the comparison bounds that can never hold in the stencil reference check. Load the compute shader register and specials pointers through uintptr_t so the copied width is the pointer size rather than a sizeof on a pointer. Report an mspace insert failure instead of returning success, qualify the replay destructor's virtual calls, cover the remaining tessellation attribute kinds, and drop the unused cutStart parameter from the instruction rewriter.
6fae5f4 to
a4d01ff
Compare
|
Resolved the overlap report from the bot:
|
|
@zoelmoj Could you add regressions that distinguish these fixes from main for default-decoded AGC state, out-of-range recorder source indexes, widened boundary arithmetic, mspace duplicate/failure results, and ThreadOwned registration-allocation failure cleanup? Please split unrelated NGS2/IME/relinker cleanups or explain their common scope. Existing passing tests and disappearing diagnostics do not establish the before/after behaviour of these changes. |
|
A note for the merge order, from #12085 (JobManager workers spin on an epoch counter instead of the manager lock). A reviewer flagged that PR and this one as conflicting in AI-assisted: yes (Claude Code). |
|
Thank you for your work on this. Main has moved, and the PR now conflicts in:
Could you merge current Thank you! |
What
Fixes undefined-behaviour and correctness defects in the AGC driver, guest libc, NGS2, IME, VideoOut, the shader recompiler and the relinker:
Graphics::State,ShaderStages,ColorTargetandDepthTargethad members without initializers (scissor,cullMode,frontFace,blend,blendConstants,viewport,renderExtent,topology,hasColorTarget,negativeOneToOne,path,registerValue, the wave sizes,address,extent,format,bytes,componentMapping,clearDepth,clearStencil).Driver::sameDecodecomparesblendConstantsand the sample masks, so a default-constructedStateread indeterminate memory.Ngs2CustomModuleOptionis a 4-bytesizefield;OptionWordread 4 bytes at offset 4, past the declared object. It now validates the guest-declared option size and returns the option error code when the option is truncated.RecorderindexedsyncWaitedMs[source](5 entries) and, insideCountThreadSync,counts[source]andwaitedMs[source], before any range check.ThreadOwnedlost the object whenpush_backthrew while registering it.sceLibcMspaceCreatereturned success when the map insertion failed.MultisampledDepthBytes,StorageTexture::sliceWindows, the vertex input table read,VideoOutDriver::processFlipand the Mach-O init stub displacement.Sequence::SubmitComputecopied the compute shader register and specials pointers withsizeofapplied to pointer variables, which reads as a mistake. The copy now goes throughstd::uintptr_t, so the width is the pointer size by construction.fprintfreceivedRegisters::Referenceproxies (Pm4 context trace) and uncast register values (draw capture dump).StencilReferenceUnusedcomparedVkCompareOpagainstVK_COMPARE_OP_NEVER, which is 0 and therefore unreachable.FilterTextcomputedtype - 0x100onstd::uint32_tbefore checkingtype >= 0x100.~Replaycalled its virtualCancel/Waitunqualified, the tessellation attribute switch leftInstanceInput/InstanceOutputimplicit, andAdjustedDeltacarried an unusedcutStartparameter.Tested
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release ...,cmake --build build --parallel 12andcmake --build build --target libs --parallel 12all succeed on top of currentmain; the patched.prxset is produced.ctest -R '^(mspace|agc_driver_pm4|agc_driver_draw_program_trace|guest_ime_filter_text|ngs2_core_render)$': 5/5 pass.clang-tidy -p build -checks='-*,bugprone-sizeof-expression' core/libs/prx/libSceJobManager/Export.cpp: reportedExport.cpp:349before the change, nothing after it.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1and the validation layer still need a run on hardware.python3 tools/check_conventions.py --base origin/mainpasses.python3 tools/pr_overlap.py --branch fix/agc-state-init-and-boundsreports file-level overlap with open PRs that implement unrelated features and fixes. The two hunks that duplicated open work were dropped: the DepthSurface tile-mode format is fix(agc): pass the tile mode of a mismatched depth plane copy as an int #7504, and theSequence::Advanceerase line is replaced by fix(job-manager): keep scheduling state in caller memory #10231/fix(job-manager): forward native profiler lifecycle events #10244.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)